#!/usr/bin/env python
"""
启动Celery beat的脚本
"""
import subprocess
import os

if __name__ == '__main__':
    # 获取当前目录
    current_dir = os.path.dirname(os.path.abspath(__file__))

    # 构建命令
    cmd = [
        'celery',
        '-A',
        'tasks',
        'beat',
        '--loglevel=info'
    ]

    print("启动Celery beat...")
    print(f"执行命令: {' '.join(cmd)}")

    # 执行命令
    subprocess.run(cmd, cwd=current_dir)
